package com.harmontronics.hanma.paas.paas.domain.app.repository.persistence;

import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.Fields;
import com.harmontronics.hanma.paas.paas.domain.app.repository.mapper.HmFolderMapper;
import com.harmontronics.hanma.paas.paas.domain.app.repository.po.HmFolderPO;
import org.springframework.stereotype.Repository;


/**
 * @author ldb
 */
@Repository("hmFolderRepository")
public class HmFolderRepository extends ServiceImpl<HmFolderMapper, HmFolderPO> {

    public IPage<HmFolderPO> selectPage(QueryWrapper<HmFolderPO> queryWrapper, Page<HmFolderPO> page) {
        return baseMapper.selectPage(page, queryWrapper);
    }


    public HmFolderPO findByName(String name) {
        QueryWrapper<HmFolderPO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(Fields.NAME, name);
        return baseMapper.selectOne(queryWrapper);
    }
}